package com.igeek.base.ch0710;

/**
 * @Description TODO
 * @Author chenmin
 * @Date 2024/7/10 15:17
 * 4.数组练习：
 * 	练习1：把一个数组元素逆序交换，int[] a ={5,11,15,24,36,47,59,66};
 * 		     交换元素后int[] a ={66,59,47,36,24,15,11,5}
 */
public class Demo4 {
    public static void main(String[] args) {
        int[] a = {5,11,15,24,36,47,59,66};
        int b,n=a.length;
        for (int i=0;i<n/2;i++){
            b=a[i];
            a[i]=a[n-i-1];
            a[n-i-1]=b;
        }
        System.out.print("交换元素后int[] a =");
        for (int i = 0; i <n; i++) {
            System.out.print(a[i]+",");
        }

    }

}
